package com.jiaai.web.zfp_back.member;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jiaai.member.api.IAccusatTypeApi;
import com.jiaai.member.model.TAccusattypeVO;
import com.jiaai.util.RestResultGenerator;
import org.springframework.web.bind.annotation.*;

/**
 * class_name:ZBYukuController
 * describe:TODO
 * create_user:张昉平
 * create_date:2018/1/6
 * create_date:15:45
 */
@RestController
@RequestMapping("/api/v1/admin/accusatType")
public class TAccusatTypeController {

    @Reference
    private IAccusatTypeApi iAccusatTypeApi;

    @GetMapping("/list")
    public Object list(){
        return RestResultGenerator.genSuccessResult(iAccusatTypeApi.getAll());
    }

    @PostMapping("/save")
    public Object saveOrEdit(@RequestBody TAccusattypeVO tAccusattypeVO){
        iAccusatTypeApi.saveOrEdit(tAccusattypeVO);
        return RestResultGenerator.genSuccessResult("成功");
    }

    @PostMapping("/delete/{id}")
    public Object delete(@PathVariable("id") Integer id){
        iAccusatTypeApi.delete(id);
        return RestResultGenerator.genSuccessResult("成功");
    }

}
